package com.test.design.pattern.decorator;

/**
 * @ClasName Egg
 * @Descripution TODO
 * @Author leikw
 * @Date 2021/12/16 10:13
 * @Version V1.0
 */
public class Bacon extends Garnish {


    public Bacon(FastFood fastFood) {
        super(fastFood, 2, "培根");
    }

    public float cost() {
        //计算价格
        return getPrice() + getFastFood().cost();
    }

    @Override
    public String getDesc() {
        return super.getDesc() + getFastFood().getDesc();
    }
}
